function(configure_protobuf)
    if (NOT TARGET libprotobuf-lite)
        message(STATUS "Configuring protobuf...")
        option(protobuf_BUILD_TESTS "" OFF)
        option(protobuf_BUILD_EXAMPLES "" OFF)
        if (${CMAKE_SYSTEM_NAME} STREQUAL "Android")
            option(protobuf_BUILD_PROTOC_BINARIES "" OFF)
        else()
            option(protobuf_BUILD_PROTOC_BINARIES "" ON)
        endif()
        add_subdirectory(${PROJECT_SOURCE_DIR}/third_party/protobuf/cmake)
        if (protobuf_BUILD_PROTOC_BINARIES)
            add_executable(protobuf::protoc ALIAS protoc)
        endif()
    endif()
    add_library(protobuf::libprotobuf-lite ALIAS libprotobuf-lite)
endfunction()
